<template>
  <h1>EL组件-单选</h1>
  <el-radio-group v-model="edu">
    <el-radio label="学历：初中" value="初中"></el-radio>
    <el-radio label="学历：高中" value="高中"></el-radio>
    <el-radio label="学历：本科" value="本科"></el-radio>
    <el-radio label="学历：硕士" value="硕士"></el-radio>
    <el-radio label="学历：博士" value="博士"></el-radio>
  </el-radio-group>
  <h4>您选择的学历是：{{edu}}</h4>
  <hr>
  <el-radio-group v-model="pri">
    <el-radio-button v-for="p in arr" :label="p.title" :value="p.price"></el-radio-button>
  </el-radio-group>
  <h4>您选择的酒价为：{{pri}}</h4>
</template>

<script setup>
import {ref} from "vue";

//1.定义变量用来保存单选提交的值
const edu = ref('');
//2.定义数组用来保存商品，模拟从后端查回来的数据
const arr = ref([
  {title:'茅台',price:'800'},
  {title:'五粮液',price:'700'},
  {title:'景芝',price:'600'},
  {title:'梦之蓝',price:'500'}
]);
//3.定义变量用来保存酒价
const  pri = ref();
</script>

<style scoped>

</style>